package xps.and.uudaijia.userclient.util;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Created by Administrator on 2017/8/1.
 */

public class MyReceiver extends BroadcastReceiver {
    private Message message;

    @Override
    public void onReceive(Context context, Intent intent) {
        //接收MainActivity传过来的数据
        String getCouponId = intent.getStringExtra("getCouponId");
        String getCouponMoney = intent.getStringExtra("getCouponMoney");
        String getCouponIdPD = intent.getStringExtra("getCouponIdPD");
        //调用Message接口的方法
        message.getMsg(getCouponId, getCouponMoney, getCouponIdPD);
    }

    public interface Message {
        public void getMsg(String getCouponId, String getCouponMoney, String getCouponIdPD);
    }

    public void setMessage(Message message) {
        this.message = message;
    }
}